using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using AvaProvi;
using Brain;

namespace AvaProvi
{
    public partial class ctlEquipamento : AvaProvi.ControlBase
    {
        VSimbolo vs;
        public ctlEquipamento()
            : base()
        {
            InitializeComponent();
        }

        public override void ActualizaDatos()
        {
            clsAvaluo_CRN.AvaluoActual.Guardar();
            ActualizaPanel();
        }

        public override void ActualizaPanel()
        {
            this.bsBancos.DataSource = clsAvaluo_CRN.AvaluoActual.Inmueble.Bancos;
            this.bsBancos.ResetBindings(false);
            this.bsEscuelas.DataSource = clsAvaluo_CRN.AvaluoActual.Inmueble.Escuelas;
            this.bsEscuelas.ResetBindings(false);
            this.bsEstacionTrans.DataSource = clsAvaluo_CRN.AvaluoActual.Inmueble.EstacionTransporte;
            this.bsEstacionTrans.ResetBindings(false);
            this.bsHospitales.DataSource = clsAvaluo_CRN.AvaluoActual.Inmueble.Hospitales;
            this.bsHospitales.ResetBindings(false);
            this.bsIglesia.DataSource = clsAvaluo_CRN.AvaluoActual.Inmueble.EquipamentoIglesia;
            this.bsIglesia.ResetBindings(false);
            this.bsMercados.DataSource = clsAvaluo_CRN.AvaluoActual.Inmueble.EquipamentoMercados;
            this.bsMercados.ResetBindings(false);
            this.bsParques.DataSource = clsAvaluo_CRN.AvaluoActual.Inmueble.PlazasJardines;
            this.bsParques.ResetBindings(false);
            this.bsPlazaPub.DataSource = clsAvaluo_CRN.AvaluoActual.Inmueble.EquipamentoPlazasPub;
            this.bsPlazaPub.ResetBindings(false);
        }

        private void iglesiaTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (iglesiaTextBox.Text).Trim());
        }

        private void mercadosTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (mercadosTextBox.Text).Trim());
        }

        private void plazasPublicasTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (plazasPublicasTextBox.Text).Trim());

        }

        private void parquesTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (parquesTextBox.Text).Trim());
        }

        private void escuelasTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (escuelasTextBox.Text).Trim());
        }

        private void hospitalesTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (hospitalesTextBox.Text).Trim());

        }

        private void bancosTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (bancosTextBox.Text).Trim());
        }

        private void estacionTransporteTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (estacionTransporteTextBox.Text).Trim());
        }
    }
}
